package com.mofang.powerdekorhelper.utils;

/**
 * Created by luofei on 2016/7/23 0023.
 */
public class StringUtils {


    public static String getProvinceName(String provinceName) {

        String mMrovinceName = provinceName;

        if (provinceName.contains("广西") || provinceName.contains("宁夏") || provinceName.contains("西藏") || provinceName.contains("新疆")
                || provinceName.contains("香港") || provinceName.contains("澳门")) {
            mMrovinceName = provinceName.substring(0, 2);
        } else {
            if (provinceName.length() > 3) {
                mMrovinceName = provinceName.substring(0, 3);
            }
        }
        return mMrovinceName;
    }

    // 验证手机号是否符合规范
    public static Boolean isPhoneNumAvaliable(String phoneNum) {
        String telRegex = "[1][3578]\\d{9}";
        return phoneNum.matches(telRegex);
    }

}
